<include file="Public:header" />

<div id="page-body">
    <div id="qan-breadcrumbs"><span><a href="{$_global.site_url}">{$Think.lang.home}</a></span>&gt;&nbsp;<span><a href="{$user.user_id|format_user_url=$user['username']}">{$Think.lang.user_activity}</a></span>&gt;&nbsp;<span>{$Think.lang.user_qa}</span></div>
    <div id="qan-content">
        <div id="user-qa-container">
            <ul id="qa-nav" class="tabs">
                <li <eq name="type" value="answered">class="current"</eq>><a href="{:U('User/qa',array('uid'=>$user['user_id'],'type'=>'answered'))}">{$Think.lang.user_answers}</a></li>
                <li <eq name="type" value="team-answered">class="current"</eq>><a href="{:U('User/qa',array('uid'=>$user['user_id'],'type'=>'team-answered'))}">{$Think.lang.user_team_answers}</a></li>
                <li <eq name="type" value="asked">class="current"</eq>><a href="{:U('User/qa',array('uid'=>$user['user_id'],'type'=>'asked'))}">{$Think.lang.user_questions}</a></li>
                <li <eq name="type" value="starred">class="current"</eq>><a href="{:U('User/qa',array('uid'=>$user['user_id'],'type'=>'starred'))}">{$Think.lang.user_starred_questions}</a></li>
                <eq name="user.user_id" value="$_user['user_id']">
                <li <eq name="type" value="followed">class="current"</eq>><a href="{:U('User/qa',array('uid'=>$user['user_id'],'type'=>'followed'))}">{$Think.lang.user_followed_questions}</a></li>
                </eq>
            </ul>
            <form method="POST" action="{:U('User/qa')}">
            <if condition="$user['perms']['share_qa_activity']">
                <notempty name="questions">
                <ul class="questions">
                    <volist name="questions" id="vo" mod="2">
                    <li id="question-{$vo.question_id}" class="item <eq name="mod" value="0">alt</eq>">
                        <eq name="allowRemove" value="1">
                        <div class="mark"><input type="checkbox" name="mods[]" value="{$vo.question_id}" /></div>
                        </eq>
                        <div class="avatar"><a href="{$vo.user_id|format_user_url=$vo['username']}"><img src="{$vo.email|get_avatar}" alt="{$vo.username}" /></a></div>
                        <div class="info">
                            <h3><a href="{$vo.question_id|format_question_url=$vo['title']}">{$vo.title}</a> - <span class="status">{$vo.status|get_question_status}</span></h3>
                            <ul class="meta">
                                <li class="stars"><a href="#nogo"><span class="star-count has-stars">{$vo.star_count}</span><span class="star">Stars</span></a></li>
                                <li>{$Think.lang.asked_by} <a href="{$vo.user_id|format_user_url=$vo['username']}">{$vo.username}</a> - </li>
                                <li>{$Think.lang.in} <a href="{$vo.category_id|format_category_url}">{$vo.category_id|get_category_name}</a> - </li>
                                <li>{$vo.answer_count} {$Think.lang.answer_count} - </li>
                                <li><abbr title="{$vo.create_time|format_date}">{$vo.create_time|pretty_date}</abbr></li>
                            </ul>
                        </div>
                    </li>
                    </volist>
                </ul>
                <eq name="allowRemove" value="1">
                <p>
                    <input id="mark-all" type="checkbox" name="mark_all" value="1" />
                    <input class="button" type="submit" name="delete" value="{$Think.lang.remove}" />				                    
				    <input type="hidden" name="uid" value="{$user.user_id}" />
				    <input type="hidden" name="type" value="{$type}" />
                </p>
                </eq>
                <div class="pagination">{$pagination}</div>
                <else/>
                <p class="no-results">{$Think.lang.user_no_results}</p>
                </notempty>
            <else/>
            <p class="tips">{$Think.lang.user_private_activity}</p>
            </if>    
    		</form>
        </div>
    </div>

    <div id="qan-sidebar">
        <include file="User:sidebar" />
    </div>
</div>

<include file="Public:footer" />

<load href="__PUBLIC__/Js/jquery.selectAll.js" />
<script type="text/javascript">
$('#mark-all').selectAll({range:'.mark'});
</script>
